import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;

public class TestDemo2 {
    public static void main(String[] args) {
        Collection<String> list = new ArrayList<>();
        list.add("我");
        list.add("爱");
        list.add("java");
        System.out.println(list.size());
        System.out.println(list.isEmpty());
        System.out.println(list.remove("爱"));
        System.out.println(list);
//        list.clear();
//        System.out.println(list);
        Object[] object = list.toArray();             //返回一个装有所有集合中元素的数组
        System.out.println(Arrays.toString(object));
        for (String s:list) {
            System.out.print(s+" ");
        }
    }
}
